package indi.mumu.service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import indi.mumu.common.model.Saleorder;
import indi.mumu.common.model.Saleorderitem;
import indi.mumu.util.RandomNumberUtils;
import indi.mumu.util.TimeUtils;

public class SaleOrderService {
	
	public Saleorder addSaleOrder(Saleorder saleOrder) {
		
		String saleOrderId = TimeUtils.getCurrentTime() + RandomNumberUtils.getRandomNumber();
		
		saleOrder.setSaleorderId(saleOrderId);
		saleOrder.setSaleDateTime(new Date());
		saleOrder.setTotal(BigDecimal.valueOf(0));
		saleOrder.setStuff("A002");
		saleOrder.setState("已下单");
		
		saleOrder.save();
		
		return saleOrder;
		
	}

}
